Skip to content

Instantly share code, notes, and snippets.

@kennypete
kennypete / navigating_the_modes_of_Vim.md
Created April 18, 2024 20:46
Navigating the modes of Vim

Navigating the modes of Vim

This diagram illustrates navigating through Vim’s modes. It was built factoring Vim 9 (i.e., all its modes, including up to two new modes, cr and cvr, in November 2023). Information about the state() and 'showmode' is provided too.

SVG version

Some features are only available in the SVG version. It is not provided directly from within this gist’s files because SVGs do not always play nicely in GitHub (particularly, refusing to display embedded fonts).

The SVG version includes hover text help, which shows pertinent information about the underlying key, command, mode, etc.

/* Merge sort in C */
#include<stdio.h>
#include<stdlib.h>
// Function to Merge Arrays L and R into A.
// lefCount = number of elements in L
// rightCount = number of elements in R.
void Merge(int *A,int *L,int leftCount,int *R,int rightCount) {
int i,j,k;
@luxplanjay
luxplanjay / flex-basis-calc.css
Last active May 11, 2024 15:56
Формула расчёта ширины flex-элемента в сетке
.element {
flex-basis: calc((100% - кол-во маржинов в строке * значение маржина) / кол-во элементов в строке);
}
@FlandreDaisuki
FlandreDaisuki / slido-mark-as-read.user.js
Created May 11, 2024 15:43
安裝 Tampermonkey 後,點 Raw 下載→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→↘
// ==UserScript==
// @name slido mark as read
// @namespace https://flandre.tw
// @version 0.0.1
// @description Add "mark as read" function to slido question
// @author FlandreDaisuki
// @match https://app.sli.do/event/*
// @require https://unpkg.com/winkblue@0.0.5/dist/winkblue.umd.js
// @icon https://www.google.com/s2/favicons?sz=64&domain=sli.do
// @grant none
@hakerdefo
hakerdefo / sources.list
Created June 11, 2023 18:47
Debian 12 "bookworm" complete sources.list
deb https://ftp.debian.org/debian/ bookworm contrib main non-free non-free-firmware
# deb-src https://ftp.debian.org/debian/ bookworm contrib main non-free non-free-firmware
deb https://ftp.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware
# deb-src https://ftp.debian.org/debian/ bookworm-updates contrib main non-free non-free-firmware
deb https://ftp.debian.org/debian/ bookworm-proposed-updates contrib main non-free non-free-firmware
# deb-src https://ftp.debian.org/debian/ bookworm-proposed-updates contrib main non-free non-free-firmware
deb https://ftp.debian.org/debian/ bookworm-backports contrib main non-free non-free-firmware
#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
@wojteklu
wojteklu / clean_code.md
Last active May 11, 2024 15:47
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@reinvanoyen
reinvanoyen / terminal-prompt-git-branch-zsh.md
Last active May 11, 2024 15:42
Add Git Branch Name to Terminal Prompt (MacOS zsh)

Add Git Branch Name to Terminal Prompt (zsh)

Updated for MacOS with zsh

  • Catalina
  • Big Sur
  • Monterey
  • Ventura
  • Sonoma

screenshot